import _00GraphFuc as gf
import _00GraphTreeFuc as gt

#12.4.2构建霍夫曼树并将其转换为图结构
W=[[0.08,'a'],[0.10,'b'],[0.12,'e'],[0.15,'d'],[0.20,'e'],[0.35,'f']]
tree=gt.Huffmantree(W)
print(tree)
gtree=gt.Huffmantree2graph(tree)
gf.drawgraph(gtree)
print(gtree)